package zettel2.a1
import scala.math._


class Haller(val matr:Int, val male:Boolean, val addr:String, val name:String) extends Person with Sex with Student {


  def inLecture(): Boolean = random > 0.5

  override def toString():String ={
      name + "," + (if(male) "m," else "f,") + matr + (if(inLecture) ",studiert" else ",studiert nicht")
  }
}

object Haller {
  def apply(matr:Int, male:Boolean, addr:String, name:String)={new Haller(matr,male,addr,name)}
}